<toolbar id="toolbar">
	<form id="order_search" class="form-horizontal">
		<div class="filter-groups">
			<div class="control-group" >
				<label class="control-label">店铺名</label>
				<div class="controls">
				<select name="shop_id" " style="width:150px;">
					<option value="">全部店铺</option>
					<foreach name="shop" item="item">
					<option value="{$item.id}">{$item.name}</option>
				    </foreach>
				</select>
				</div>
			</div>
		</div>
		
		<div class="filter-groups">
			<div class="control-group">
				<label class="control-label" style="width:70px;">操作人</label>
				<div class="controls" style="margin-left:70px;">
					<select name="uid" id="sel_users" style="width:150px;">
					  <option value="">全部</option>
		              <foreach name="users" item="item">
						<option value="{$item.id}">{$item.nick}-{$item.username}</option>
					  </foreach>
					</select>
				</div>
			</div>
		</div>
		
		<div class="filter-groups">
			<div class="control-group">
			<label class="control-label">操作时间</label>
			<div class="controls">
				<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss" >
					<input type="text" name="start_date" value="{$start_date}">
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
				至
				<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
					<input type="text" name="end_date" value="{$end_date}"">
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>
			</div>
		</div>
		
		
	</form> 
</toolbar>
<!-- 表格 -->
<table id="table" data-toggle="gridview" class="table table-hover" data-url="__URL__" data-toolbar="#toolbar"  data-page-list="[1, 10, 25, 50, All]">
    <thead>
		<tr>
			<th data-field="name" data-width="110">店铺名</th>
			<th data-field="username" data-width="90">操作人</th>
			<th data-field="trade_count" data-width="60">订单总数</th>
		    <th data-field="created" data-width="110">操作时间</th>
		</tr>
	</thead>
</table>

<script type="text/javascript" src="//cdn.bootcss.com/select2/4.0.3/js/select2.min.js"></script>
<link rel="stylesheet" href="//cdn.bootcss.com/select2/4.0.3/css/select2.min.css">

<script>
$(function(){
	$('#table').on('down',function(e, gridview ,params){
		var row = gridview.currentRow; 
		if(!row){ 
			alertMsg('请选择需要下载的数据', 'warning');
			return false; 
		}
		var url = '__URL__/down?id=' + row.id;
		window.open(url);
		return false;
	});
});

//多选
$("#sel_users").select2();
</script>
